home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 2001 May / SGI Freeware 2001 May - Disc 3.iso / dist / fw_expect.idb / usr / freeware / bin / rlogin-cwd.z / rlogin-cwd
Text File  |  1999-01-26  |  401b  |  15 lines

  1. #!/usr/freeware/bin/expect --
  2. # rlogin-cwd - rlogin but with same directory
  3. #
  4. # You can extend this idea to save any arbitrary information across rlogin
  5. # Don Libes -  Oct 17, 1991.
  6.  
  7. set prompt "(%|#|\\$) $"        ;# default prompt
  8. catch {set prompt $env(EXPECT_PROMPT)}
  9.  
  10. eval spawn rlogin $argv
  11. set timeout 60
  12. expect eof exit timeout {send_user "timed out\n"; exit} -re $prompt
  13. send "cd [pwd]\r"
  14. interact
  15.